Unit BDojoxDataGridUnit;

{$mode objfpc}{$H+}

Interface

Uses
  Classes, SysUtils, BDojoSessionUnit, BDojoxGridUnit, BDojoStoreUnit;

Type

{ BDojoxDataGridClass }

//**

BDojoxDataGridClass = Class(BDojoxGridClass)
  Private
    bFetchText: String;
    bStore: BDojoObjectClass;
    bStructure: String;
    Procedure SetFetchText(aValue: String);
    Procedure SetStore(aValue: BDojoObjectClass);
    Procedure SetStructure(aValue: String);
  Public
    //**
    //TODO: add FetchText description
    Property FetchText: String Read bFetchText Write SetFetchText;
    //**
    //TODO: add Structure description
    Property Structure: String Read bStructure Write SetStructure;
    //**
    //TODO: add Store description
    Property Store: BDojoObjectClass Read bStore Write SetStore;

    Constructor Build(Const aSession: BDojoSessionClass;
      Const aJSType: String = ''); override;
End;

Implementation

{ BDojoxDataGridClass }

Procedure BDojoxDataGridClass.SetFetchText(aValue: String);
Begin
  bFetchText := aValue;
End;

Procedure BDojoxDataGridClass.SetStore(aValue: BDojoObjectClass);
Begin
  Associate(aValue);
  bStore := aValue;
  SetConfig('store', aValue);
End;

Procedure BDojoxDataGridClass.SetStructure(aValue: String);
Begin
  bStructure := aValue;
  SetConfig('structure', aValue, FALSE);
End;

Constructor BDojoxDataGridClass.Build(Const aSession: BDojoSessionClass;
  Const aJSType: String);
Begin
  If aJSType = '' Then Inherited Build(aSession, 'dojox.grid.DataGrid')
  Else Inherited Build(aSession, aJSType);
  Session.AddDynamicCSS('../dojo/dojox/grid/resources/Grid.css');
  Session.AddDynamicCSS('../dojo/dojox/grid/resources/%sGrid.css',
    [Session.Theme]);
  Session.AddRequire('dojo.data.ObjectStore');
  bSrcNodeRef := BuildDynamicElement;
End;

End.

